package com.zyg.zlib;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.ImageView;

import com.zyg.zlib.utils.DensityUtil;
import com.zyg.zlib.widget.GifLableDrawable;
import com.zyg.zlib.widget.LableDrawable;

public class LableDrawableActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.lable_drawable_layout);
        setTitle(LableDrawableActivity.class.getSimpleName());

        int dp5 = DensityUtil.dp2px(mSelf, 5);
        int dp4 = DensityUtil.dp2px(mSelf, 4);
        int dp12 = DensityUtil.dp2px(mSelf, 12);
        int dp10 = DensityUtil.dp2px(mSelf, 10);
        int dp2 = DensityUtil.dp2px(mSelf, 2);
        int dp1 = DensityUtil.dp2px(mSelf, 1);

        ImageView imageView1 = findViewById(R.id.iv1);

        Drawable yugao = LableDrawable.Builder.newBuilder(mSelf)
                .padding(dp5, dp4, dp5, dp4)
                .textBold(true)
                .icon(R.drawable.mtt_yugao_lable)
                .gap(dp4)
                .text("预告", dp12, R.color.white)
                .gradient(45, R.color.jm_FF517CF0, R.color.jm_FF769EF5)
                .radius(dp10, dp2, dp2, dp10)
                .build();
        imageView1.setImageDrawable(yugao);

        ImageView imageView2 = findViewById(R.id.iv2);
        Drawable huigu = LableDrawable.Builder.newBuilder(mSelf)
                .padding(dp5, dp4, dp5, dp4)
                .icon(R.drawable.mtt_huigu_lable)
                .gap(dp4)
                .text("回顾", dp12, R.color.jmui_FF4D80F0)
                .textBold(true)
                .stroke(3, R.color.jmui_FF4D80F0)
                .radius(dp10, dp2, dp2, dp10)
                .build();
        imageView2.setImageDrawable(huigu);

        ImageView imageView3 = findViewById(R.id.iv3);
        GifLableDrawable zhibo = GifLableDrawable.Builder.newBuilder(mSelf)
                .padding(dp5, dp4, dp5, dp4)
                .icon(R.drawable.mtt_living)
                .gap(dp4)
                .text("直播", dp12, R.color.white)
                .textBold(true)
                .gradient(45, R.color.jm_FFE63E46, R.color.jm_FFFF4049)
                .radius(dp10, dp2, dp2, dp10)
                .singleView(true)
                .build();
        imageView3.setImageDrawable(zhibo);

        ImageView imageView4 = findViewById(R.id.iv4);
        Drawable article = LableDrawable.Builder.newBuilder(mSelf)
                .padding(dp5, dp4, dp5, dp4)
                .icon(R.drawable.mtt_topic_article)
                .gap(dp4)
                .text("文章专题", dp12, R.color.white)
                .textBold(true)
                .gradient(45, R.color.jm_FF20B080, R.color.jm_FF2BD69D)
                .radius(dp10, dp2, dp2, dp10)
                .build();
        imageView4.setImageDrawable(article);

        ImageView imageView5 = findViewById(R.id.iv5);
        Drawable discuss = LableDrawable.Builder.newBuilder(mSelf)
                .padding(dp5, dp4, dp5, dp4)
                .icon(R.drawable.mtt_topic_discuss)
                .gap(dp4)
                .text("讨论专题", dp12, R.color.white)
                .textBold(true)
                .gradient(45, R.color.jm_FF20B080, R.color.jm_FF2BD69D)
                .radius(dp10, dp2, dp2, dp10)
                .build();
        imageView5.setImageDrawable(discuss);

    }


}
